Class awt.FontMetrics
All Packages    This Package    Previous    Next

Class awt.FontMetrics

java.lang.Object
   |
   +----awt.FontMetrics

public class FontMetrics
extends Object
A font metrics object.
Version:
1.2 10 Apr 1995
Author:
Jim Graham

ascent
The standard ascent of the font.
descent
The standard descent of the font.
height
The standard height of a line of text in this font.
leading
The standard leading for the font.
maxAdvance
The maximum advance width of any character in this font.
maxAscent
The maximum ascent for all characters in this font.
maxDescent
The maximum descent for all characters in this font.
maxHeight
The maximum possible height of a line of text in this font.
widths

bytesWidth(byte[], int, int)
Return the width of the specified byte[] in this Font.
charWidth(int)
Return the width of the specified character in this Font.
charsWidth(char[], int, int)
Return the width of the specified char[] in this Font.
stringWidth(String)
Return the width of the specified string in this Font.
toString()
Convert this object to a string representation.

widths
  public int widths[]
ascent
  public int ascent
The standard ascent of the font. This is the logical height above the baseline for the Alphanumeric characters and should be used for determining line spacing. Note, however, that some characters in the font may extend above this height.
descent
  public int descent
The standard descent of the font. This is the logical height below the baseline for the Alphanumeric characters and should be used for determining line spacing. Note, however, that some characters in the font may extend below this height.
leading
  public int leading
The standard leading for the font. This is the logical amount of space to be reserved between the descent of one line of text and the ascent of the next line. The height metric is calculated to include this extra space.
height
  public int height
The standard height of a line of text in this font. This is the distance between the baseline of adjacent lines of text. It is the sum of the ascent+descent+leading. There is no guarantee that lines of text spaced at this distance will be disjoint; such lines may overlap if some characters overshoot the standard ascent and descent metrics.
maxAscent
  public int maxAscent
The maximum ascent for all characters in this font. No character will extend further above the baseline than this metric.
maxDescent
  public int maxDescent
The maximum descent for all characters in this font. No character will descend further below the baseline than this metric.
maxHeight
  public int maxHeight
The maximum possible height of a line of text in this font. Adjacent lines of text spaced this distance apart will be guaranteed not to overlap. Note, however, that many paragraphs that contain ordinary alphanumeric text may look too widely spaced if this metric is used to determine line spacing. The height field should be preferred unless the text in a given line contains particularly tall characters.
maxAdvance
  public int maxAdvance
The maximum advance width of any character in this font.

toString
  public String toString()
Convert this object to a string representation.
Overrides:
toString in class Object

charWidth

  public abstract int charWidth(int ch)
Return the width of the specified character in this Font.

stringWidth

  public abstract int stringWidth(String s)
Return the width of the specified string in this Font.

charsWidth

  public abstract int charsWidth(char data[],
                                 int off,
                                 int len)
Return the width of the specified char[] in this Font.

bytesWidth

  public abstract int bytesWidth(byte data[],
                                 int off,
                                 int len)
Return the width of the specified byte[] in this Font.


All Packages    This Package    Previous    Next